package com.rules.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rules.admin.dao.UnitCaseExpectResultDao;
import com.rules.admin.entity.UnitCaseExpectResult;
import com.rules.admin.service.UnitCaseExpectResultService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UnitCaseExpectResultServiceImpl extends ServiceImpl<UnitCaseExpectResultDao, UnitCaseExpectResult> implements UnitCaseExpectResultService {
   public List<UnitCaseExpectResult> findExpectResultByCaseId(Long unitCaseId) {
      LambdaQueryWrapper<UnitCaseExpectResult> queryWrapper = new LambdaQueryWrapper<>();
      queryWrapper.ge(UnitCaseExpectResult::getUnitCaseId,unitCaseId);
      return this.baseMapper.selectList(queryWrapper);
   }

   public UnitCaseExpectResult findOneExpectResultByCaseId(Long unitCaseId) {
      LambdaQueryWrapper<UnitCaseExpectResult> queryWrapper = new LambdaQueryWrapper<>();
      queryWrapper.ge(UnitCaseExpectResult::getUnitCaseId,unitCaseId);
      return this.baseMapper.selectOne(queryWrapper);
   }
}
